<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>邮件系统</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
	
	<th:block th:include="include/src :: grid_base_js_and_css"/>
	<!-- form style -->
	<link rel="stylesheet" href="/static/admin/css/mini-ease-edit.css">
	
	<style>
	html {height: 100vh;background-color: #e4e6e9;}
	body {height: 100vh;}
	ul { list-style:none; margin:0; padding:0; border:0; font-size:13px;color:#000}
	
	.layui-nav {background-color: #ffffff;}
	.layui-nav-item {line-height: 30px !important;}
	.layui-nav-item > a {height: 30px !important; line-height: 30px !important; color: #000000 !important;}
	</style>
</head>
<body>
	<div class="display_flex" style="height: calc(100% - 5px);" id="id_panel_content">
		<!-- 树面板【start】 -->
		<div style="height: calc(100% - 5px); width: 17%; float: left;">
			<div style="overflow: auto; padding-top: 0.2rem; height: 100%;">
				<div id="id_panel_left" style="margin: 0; padding: 5px; height: calc(100% - 10px);">
					<ul class="layui-nav layui-nav-tree" lay-filter="test" style="width: 100%;">
						<li class="layui-nav-item layui-this"><a href="javascript:void(0);"><i class="layui-icon layui-icon-add-circle"></i> 新建邮件</a></li>
						<li class="layui-nav-item"><a href="javascript:void(0);"><i class="layui-icon layui-icon-email"></i> 收件箱</a></li>
						<li class="layui-nav-item"><a href="javascript:void(0);"><i class="layui-icon layui-icon-log"></i> 草稿箱</a></li>
						<li class="layui-nav-item"><a href="javascript:void(0);"><i class="layui-icon layui-icon-release"></i> 发件箱</a></li>
						<li class="layui-nav-item"><a href="javascript:void(0);"><i class="layui-icon layui-icon-delete"></i> 垃圾箱</a></li>
					</ul>
					<div class="search" style="overflow: auto; max-height: calc(100% - 200px);height: calc(100% - 200px); border-top: double rgb(255, 255, 255); background-color: #ffffff;">
						<div class="layui-side-scroll link-book" style="width: 100%;">
							<p class="shead" style="height: 35px;line-height: 35px;text-align: center;background: rgb(0, 135, 250);color: #fff;font-weight: bolder;font-size: 14px;">通讯录</p>
							<div class="layui-nav-tree">
								<div id="id_tree"></div>
							</div>
						</div>
						<form id="id_form_search" class="layui-form" style="width: 100%; display: none;">
							<p class="shead">邮件搜索</p>
							<table style="margin-top: 10px;">
								<tr><td width="65">标题：</td><td><input type="text" name="mailSubject" autocomplete="off" class="layui-input"></td></tr>
								<tr><td>正文：</td><td><input type="text" name="mailContent" autocomplete="off" class="layui-input"></td></tr>
								<tr><td>发件人：</td><td><input type="text" name="fromUserName" autocomplete="off" class="layui-input"></td></tr>
								<tr><td>收件人：</td><td><input type="text" name="toUserName" autocomplete="off" class="layui-input"></td></tr>
								<tr><td>邮件标签：</td><td><input type="text" name="mailLabel" autocomplete="off" class="layui-input"></td></tr>
								<tr><td>发送时间：</td>
									<td style="position: relative;"><input type="text" name="sendTime" id="sendTime" class="layui-input">
										<i class="dhicon dh-calendar icon_date_business" style="z-index:1"></i></td></tr>
								<tr>
									<td>紧急程度：</td>
									<td>
										<select name="urgentDegree" id="urgentDegree">
											<option value="">全部</option>
											<option value="普通">普通</option>
											<option value="加急">加急</option>
											<option value="特急">特急</option>
										</select>
									</td>
								</tr>
								<tr>
									<td>邮件状态：</td>
									<td>
										<select name="readed" id="readed">
											<option value="">全部</option>
											<option value="1">已读</option>
											<option value="0">未读</option>
										</select>
									</td>
								</tr>
								<tr>
									<td>重要邮件：</td>
									<td>
										<select name="important" id="important">
											<option value="">全部</option>
											<option value="1">是</option>
											<option value="0">否</option>
										</select>
									</td>
								</tr>
								<tr>
									<td>保留邮件：</td>
									<td>
										<select name="perpetual" id="perpetual">
											<option value="">全部</option>
											<option value="1">是</option>
											<option value="0">否</option>
										</select>
									</td>
								</tr>
								<tr>
									<td colspan="2" style="text-align: center;height: 50px;">
										<div class="layui-btn" onclick="search()">
											<p class="dhicon dh-search" style="color:white;font-size:14px"><span class="fa_span">搜 索</span></p></div>
										<div class="layui-btn layui-btn-primary" style="background: #fff !important" onclick="cleanParam()">
											<p class="dhicon dh-refresh" style="color:white;font-size:14px" id="dh-resets"><span class="fa_span">重 置</span></p></div>
									</td>
	
								</tr>
							</table>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!-- 树面板【end】 -->
		<!-- 内容面板【start】 -->
		<div style="height: calc(100% - 5px); width: 83%; float: left; padding: 5px 2px;">
			<div class="display_flex" style="height: 100%; background-color: #ffffff;">
				<!-- 写邮件【start】 -->
				<div style="padding: 5px; height: 100%;">
					<form class="layui-form" action="">
						<div class="layui-form-item btn-list" style="border-radius:10px 10px 0 0 ;">
							<div class="layui-btn layui-btn-danger layui-table-tools" onclick="savepost(1)" style="background: rgba(0,161,21,1) !important"><p class="dhicon dh-paper-plane-o" style="color:white;font-size:14px;"><span class="fa_span" style="color: #FFFFFF"><i class="layui-icon layui-icon-release"></i>发 送</span></p></div>
							<div class="layui-btn layui-table-tools importbtn-bg" onclick="savepost(0)" style="background: rgba(243,160,65,1) !important;"><p class="dhicon dh-cube" style="color:white;font-size:14px"><span class="fa_span" style="color: #FFFFFF">存草稿</span></p></div>
							<div class="layui-btn layui-table-tools importbtn-bg" onclick="getUpload('vHFilesDefault','Mail','',$('#fileFlag'));"><p class="dhicon dh-paperclip" style="color:white;font-size:14px"><span class="fa_span" id="fileFlag" style="color: #FFFFFF">附 件</span></p></div>
						</div>
						<div class="layui-form-item">
							<div class="layui-inline layui-col-xs12 margin_r_0">
								<label class="layui-form-label"><span class="getSelct" data-for="toUser"><i class="layui-icon layui-icon-list"></i>&nbsp;收件人：</span></label>
								<div class="layui-input-block margin_l_150 min_height_38">
									<input type="text" name="receiveUsers" value="" autocomplete="off" lay-verify="required" class="layui-input height_30 height_30 `cannot_edit`" readonly>
								</div>
							</div>
						</div>
						<div class="layui-form-item ccUser_box">
							<label class="layui-form-label"><span class="getSelct" data-for="ccUser"><i class="dhicon dh-newspaper-o"></i>&nbsp;抄送：</span></label>
							<div class="layui-input-block">
								<div class="ccUser_D"><input class="just_input" type="text" data-from="ccUser"></div>
								<input type="text" name="ccUserName" id="ccUserName" value="" class="layui-input get-more" data-for="ccUser" style="color:#fff;" readonly/>
								<i class="layui-icon layui-icon-more getMore" data-for="ccUser" ></i>
								<input type="hidden" name="ccUser" id="ccUser" value="" />
								<i class="dhicon dh-trash-o input-clear" title="清空" onclick="clearUser('ccUser')" style="color:red;"></i>
							</div>
						</div>
						<div class="layui-form-item" style="height: auto">
							<label class="layui-form-label">主题：</label>
							<div class="layui-input-block" style="text-align: left">
								<input type="text" name="mailSubject" id="mailSubject" class="layui-input">
								<!--					<span class="getUpload" onclick="getUpload('vHFilesDefault','Mail','',$('#fileFlag'));"><i class="dhicon dh-paperclip"></i> &nbsp;<font id="fileFlag">附件</font></span>-->
							</div>
						</div>
						<div class="layui-form-item" style="height: auto">
							<label class="layui-form-label">重要邮件：</label>
							<div class="layui-input-block" style="text-align: left">
								<input type="radio" name="important" value="1" title="是">
								<input type="radio" name="important" value="0" title="否" checked>
							</div>
						</div>
						<div class="layui-form-item" style="height: auto">
							<label class="layui-form-label">紧急程度：</label>
							<div class="layui-input-block" style="text-align: left">
								<input type="radio" name="urgentDegree" value="普通" title="普通" checked>
								<input type="radio" name="urgentDegree" value="加急" title="加急">
								<input type="radio" name="urgentDegree" value="特急" title="特急">
							</div>
						</div>
						<div class="layui-form-item" style="height: auto">
							<label class="layui-form-label">保留邮件：</label>
							<div class="layui-input-block" style="text-align: left">
								<input type="radio" name="perpetual" value="1" title="是" lay-filter="perpetual">
								<input type="radio" name="perpetual" value="0" title="否" checked lay-filter="perpetual">
								&nbsp;&nbsp;&nbsp;
								<span id="perpetual-0">【非保留邮件保留[[${mailDelDays}]]天（超期转已删除）】</span>
								<span id="perpetual-1" style="display: none">【永久保留邮件】</span>
							</div>
						</div>
			
						<div class="layui-form-item">
							<label class="layui-form-label"><span class="getSelct" data-for="mailLabel"><i class="dhicon dh-credit-card"></i>&nbsp;邮件标签：</span></label>
							<div class="layui-input-block">
								<div class="mailLabel_D"></div>
								<input type="text" name="mailLabel" id="mailLabel" value="" class="layui-input get-more" data-for="mailLabel" style="color:#fff;" readonly/>
								<i class="layui-icon layui-icon-more getMore" data-for="mailLabel" ></i>
								<i class="dhicon dh-trash-o input-clear" title="清空" onclick="clearUser('mailLabel')" style="color:red;"></i>
							</div>
						</div>
						<div class="layui-form-item contentBox" style="text-align: unset;">
							<label class="layui-form-label">正文：</label>
							<div class="layui-input-block">
								<div id="content">
								</div><br>
								<textarea id="mailContent" name="mailContent"  style="display: none"></textarea>
							</div>
						</div>
					</form>
				</div>
				<!-- 写邮件【end】 -->
			</div>
		</div>
		<!-- 内容面板【end】 -->
	</div>
	
<script type="text/javascript">
layui.config({
	//自定义layui组件的目录,设定扩展的layui模块的所在目录，一般用于外部模块扩展
	base: '/static/js/layui_extends/'
}).use(['form', 'jquery', 'laydate', 'YsForm', 'YsModal', 'dtree'], function(){
	// 初始化邮件联系人
	var DemoTree = layui.dtree.render({
		elem: "#id_tree",
		url: '/api/inter/tsOrganizationInfo/dtree',
		initLevel: "2",
		icon: -1,
		toolbar:true,
		toolbarWay:"follow",
		toolbarShow:[],
		width:'100%',
		menubar:false,
		toolbarExt: [{
			toolbarId: "add",
			icon: "dtree-icon-add-circle",
			title: "新增子机构",
			handler: function (node, $div) {
				layer.open({
					type: 2,
					title: "新增子机构",
					area: ['95%', '90%'],
					content: '/web/sys/tsOrganizationInfo/toAdd?pid=' + node.nodeId
				});
			}
		},{
			toolbarId: "edit",
			icon: "dtree-icon-bianji",
			title: "编辑此机构",
			handler: function (node, $div) {
				var content, title, url;
				layer.open({
					type: 2,
					title: "编辑",
					area: ['95%', '90%'],
					content: '/web/sys/tsOrganizationInfo/toEdit?id=' + node.nodeId
				});
			}
		}]
	});

	// 绑定节点点击
	layui.dtree.on("node('id_tree')" ,function(obj){
		var objd = obj.param;
	});
});
</script>
</body>
</html>